from dataclasses import dataclass
from datetime import datetime


@dataclass
class MemberDTO:
    id: int
    name: str
    email: str
    created_at: datetime

    @staticmethod
    def from_model(member) -> 'MemberDTO':
        return MemberDTO(
            id=member.id,
            name=member.name,
            email=member.email,
            created_at=member.created_at.strftime('%Y-%m-%d %H:%M:%S')
        )
